Preserve tracked array wrappers in restructure - #498
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
Preserve tracked array wrappers in restructure#498ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #498 +/- ##
==========================================
+ Coverage 60.75% 61.32% +0.57%
==========================================
Files 15 15
Lines 609 618 +9
==========================================
+ Hits 370 379 +9
Misses 239 239 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
ArrayInterface.restructure(tracked_template, tracked_values)currently falls through to the generic implementation. For an array ofReverseDiff.TrackedRealvalues, that produces a plain vector, so a downstream Rosenbrock stage changes fromReverseDiff.TrackedArraytoVector{TrackedReal}and cannot be assigned to the typed stage vector.This was exposed by the SciMLSensitivity Core1
BouncingBall ODEtest on clean current masters after the OrdinaryDiffEq LinearSolve 5 update. The fix belongs in the publicArrayInterface.restructureextensions rather than in an OrdinaryDiffEq workaround.Investigation process
Vector{ReverseDiff.TrackedReal{..., Nothing}}and confirmed the generic restructure stripped the wrapper._restructure_statefallback after it failed the exact solve.aos_to_soaplusreshapepreserves the tracked wrapper and gradient, then implemented that behavior in the owner extensions.Local validation
GROUP=Core julia +1.10 --project=. -e "using Pkg; Pkg.test()"Testing ArrayInterface tests passed[2.0, 2.0].[26.96250030687455, 0.0].